package pl.ptemich.tankwars.objects;

import org.newdawn.slick.Image;

import pl.ptemich.tankwars.GraphicConstants;
import pl.ptemich.tankwars.tools.LoggingTools;

public class Bug extends MovingObject {

  public static Bug getInstance() {
    Double breed = Math.random() * 1000;
    breed = Long.valueOf(Math.round(breed)).doubleValue();
    LoggingTools.debug("breed seed:" + breed);
    if (breed % 3 == 1) {
      return new Bug(GraphicConstants.BLACK_BUG_IMAGE);
    } else {
      return new Bug(GraphicConstants.WHITE_BUG_IMAGE);
    }
  }
  
  public Bug(Image view) {
    super(view);
  }

//  @Override
//  public void update(int delta) {
//    posX -= 0.2f;
//    
//    if (posX < 0) {      
//      randomPosition();
//      posX = (float) GraphicConstants.SCREEN_WIDTH - width;    
//    }
//    
//    // 50% chance
//    if (Math.random() * 10 > 5) {
//      posY += 0.1f;
//    } else {
//      posY -= 0.1f;
//    }
//  } 
}
